#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2023/10/25 00:07
# @Author  : 蓝狼
# @Email   : 1195185953@qq.com
# @File    : xueqiu.py
# @Desc    :
import json

import requests

if __name__ == '__main__':

    url = 'https://stock.xueqiu.com/v5/stock/preipo/hk/query.json?page=1&size=10&order=asc&order_by=list_date&type=unlisted'
    headers = {
        "User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
        "Referer": 'https://xueqiu.com/hq',
        "Cookie": 'xq_a_token=e2f0876e8fd368a0be2b6d38a49ed2dd5eec7557; xqat=e2f0876e8fd368a0be2b6d38a49ed2dd5eec7557; xq_r_token=2a5b753b2db675b4ac36c938d20120660651116d; xq_id_token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJ1aWQiOi0xLCJpc3MiOiJ1YyIsImV4cCI6MTcwMDY5OTg3NSwiY3RtIjoxNjk4MTYzNTUyODMyLCJjaWQiOiJkOWQwbjRBWnVwIn0.cWD19_WLd4e0qeXs21cZrwR7nmxBI0wlF0Ia1rxdghfmgW4P-OtBBaj68F98tAfLb4tOwlZan9reF-uyLqBhwv1v1nD9_yfhRo6qHXSkzxNRhFpIwMw8hE3nbBBL2GPnB3Wp4b06qYBKPWpcdHa6rsnm6gDF9ZFl16HuFFJakHW8_9sFHEjVmgjzHYsdJcLua_j0gAe7CUzJNExuy6potdtzxhFGBko9viTsgp2_lpM3Nk9Gp4Mtnwrrz8lvoBqpNiKIRjoqHtiQOedxBT27UiLKOWv4Ko-0ygJrGt3LcFavJ4cLi6VQxqpvkMKj3gl0Yh2yd494FMqGb_gshSmFJg; cookiesu=431698163559547; u=431698163559547; device_id=a25cd81c103578285a6cb653df41d5dd; Hm_lvt_1db88642e346389874251b5a1eded6e3=1698163562; s=a71fid97sk; Hm_lpvt_1db88642e346389874251b5a1eded6e3=1698163579',
    }
    resp = requests.get(url, headers=headers)
    # print(resp.status_code)
    print(resp.text)
    # print(resp.json())
    with open('xueqiu.json', 'w', encoding='utf-8') as f:
        f.write(json.dumps(resp.json(), ensure_ascii=False))




